package com.scedu.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration //@Configuration --sping applicatincontext.xml
/*
创建RestTemplate类的Bean构造器
 */
public class ConfigBean {
    //配置负载均衡实现 RestTemplate
    @Bean
    @LoadBalanced //Ribbon
    public RestTemplate getRestTemplate()
    {
        return  new RestTemplate();
    }

}
